import http from '@/http'
import qs from 'qs'

// 产品管理

// 获取产品列表
const getProductList = (params) => {
    return http.get('v1/products', {
        params,
        paramsSerializer: function (params) {
            return qs.stringify(params, { arrayFormat: 'brackets' })
        },
    })
}

// 操作产品
const operationProduct = ({ id, params }) => {
    return http.put(`v1/products/${id}/enable`, params)
}

export { getProductList, operationProduct }